package esercitazione1;

import java.util.Scanner;

public class Client1_1 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		MyStack<Character> stack = new MyStack<Character>();
		System.out.println("Inserisci una stringa da invertire:");
		String input = s.nextLine();
		char[] inputChar = input.toCharArray();
		
		for(char c : inputChar){
			stack.push(c);
		}
		
		System.out.println("\nElementi nello stack: " + stack.size());
		System.out.println(stack.toString());
		System.out.println();
		
		String output = "";
		while(!stack.isEmpty()){
			output += stack.pop();
		}
		System.out.print("Stringa invertita: ");
		System.out.println(output);

		s.close();
	}
}
